const os = require('os')
const path = require('path')
const globalStateKey = 'SNIPPET_STORAGE_TREE_DATA'

const getDefaultTreeData = () => [
    {
        "id": 1,
        "name": "默认",
        "children": []
    }
]

const getDownloadsPath = () => {
    // Windows: C:\Users\<用户名>\Downloads
    if (os.platform() === 'win32') {
        return path.join(os.homedir(), 'Downloads');
    }
    // macOS/Linux: ~/Downloads
    return path.join(os.homedir(), 'Downloads');
}

module.exports = {
    globalStateKey,
    getDefaultTreeData,
    getDownloadsPath,
}